public class Test1 {


    //1.String的构造方法
    public static void main1(String[] args) {


        //1.
        String s1="123hek";
        System.out.println(s1);

        //2.
        String s2=new String("kjn298");
        System.out.println(s2);
        //3.
        char[] ch1={'1','r','0'};
        String s3=new String(ch1);
        System.out.println(s3);


        //4.
        byte[] by={97,98,65,1};
        String s4=new String(by);
        System.out.println(s4);
    }

    //2.字符串常量池
    public static void main(String[] args) {
        String s1="12se";
        String s2="12se";
        System.out.println(s1==s2);


        String s3=new String("34e");
        String s4=new String("34e");
        String s5=s3;

        System.out.println(s3==s4);
        System.out.println(s5==s3);
    }
}
